package com.dingwen.treasure.kettle.task;

import com.dingwen.treasure.kettle.enums.FileTypeEnum;
import com.dingwen.treasure.kettle.execute.KettleExecute;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;


/**
 * 　TestJob
 * 　@author dingwen
 * 　@date 2022/5/11
 */
@Slf4j
@Component
public class FileExecuteTask extends AbstractTask {



    /**
     * kettle 执行
     */
    @Resource
    private KettleExecute kettleExecute;

    /**
     * 精确执行
     *
     * @param fileType 文件类型
     * @param fullFileName   文件全路径
     */
    @SneakyThrows
    @Override
    protected void exactExecution(FileTypeEnum fileType, String fullFileName) {
        kettleExecute.exe(fileType,fullFileName);
        log.info("转换或作业执行，fullFileName:{} ...", fullFileName);
    }
}
